Thanks Guys, I do have pull down resistors on PORTC and PORTD but overlooked the one for PORTB.2. I did install one and it did fix my problem. However I don't quite understand why this would cause the problem that I had since this switch was used only to tell the program when to write to EEPROM. By the way the Write 0, PORTC does work OK.

Thanks Again for your help
Roy