moved the debug check to initialize method