Add and remove gesture recognizer as needed