replaced nasty timeouts with less nasty .defers