Added timeOut function to test unregister.