error handling and typos