Error checking on Process, handle closing in OS