fixing end hour bug