updated handleSyscall()