Added deferred function

added deferred to request definition, added wait variable to count wait
time more intelligently