append 'Debug' mode and fixed string search