fixed toHours function