bugfix + removed debug messages