fix exception issue in debug mode