error handling in gesture.py