error handling, and fix the year problem