commenting out lines where undefined callbacks were being called in catch statements and cleaned up some syntax errors and improperly scoped variables