fixed an error in time conversions