improved error handling for process stucture