Fixed code to convert milliseconds to seconds