Quick fix threading, will be improved...