fixed defining function also when not using debug mode