Updated autocomplete checks for 'keyup' to 'keydown'