Changed checkDate function and improved fetchDay function