added configurable wait time