change conditions for debug and text of debug messages