fixed bug when calling set_duration(None)