Added additional error handling in process()