replacing idle event with timer