Update client.js

add retry