Fixed wrong variable when calculating time