additional safe check in close_proc