bug of calclating time fixed