modified setDuration so that it can be called before setup

otherwise loading inoutrange from xml during setup before setting duration won't work properly