Hopefully fixed the deadlock issue with the JVM freezing