Add HandledException and remove debug logging