Correctly setting duration