Added delay when switch is pressed