fix the broken function time-in-ms