Updated to make duration optional