fix

1. remove unused variable 'done'
2. add try/catch when complete
3. change some code in 'onrequest'