fix retrying way

- dont't sleeping inner loop
- update state and re-entry the loop when API error occured
- add queueStateRetrying