added debug messages