Added check on correct key pressed