closing process after spawn