added chdir to attach-daemon2