added delay between key actions to improve reliability