Are you using an external pullup resistor for your switch configuration?