Added function debugmode to check if debugmode is enabled