changes for error catching