retry on 5xx errors and avoid sending keys twice to the server
with queuing
remove debug msg