adds some debug messages when it's debug