fixed flawed hour calculation