fixed crash when running in --debug mode