fixed if for hour editing