check if process exists before killing