Fix isValid hour check