fixes for debug mode