Remove console print as this (may) be causing the program to freeze when called from a thread.