added error handling and op_pathset