fixed ms calculation