Done. Also, added check for duration.