fix bug in elapsed