fixed getpid syscall bug - needs error handling