TODO: fix bug thread wont wake up