Fixed bug with crashing & added syscall for threads