some changes for error handling