added some logic to fetch hours