Removed debug message and fixed freezing bug