some fixes and removed debugmessages