Inserted some debug messages