removed debug messages after problem solved