timer and keyboard interrupt working