Added code to ignore auto-repeat