cleanup and debugmessages