remove debugging, add error handling for undefined intent