used setTimeout() and clearTimeout() to save the last key up event after 5 seconds have passed