No, if you notice this check is done at the else block where the if condition checks for "tap". Do you see any other problem other than what is mentioned in the code above?