update ptrace implementation