fixed condtional fetch of records by year in the url