add detach function in create/main.c