fix error in debug mode