changes for error handling