fixed device token sending bug

-if there was an error when the token was sent, the device would
remember as the token being sent. This has been fixed