bugfixes causes program to freeze