bug in milliseconds calculation