adding in key press detection