fix calculation of fraction of second