fixed typos and improved error message