Please try without the sleep. We should avoid sleep wherever possible. Forget all networks disconnects from all networks and does not return until disconnected.