adding proper error handling to check_boxes. fixes #60