Improve error handling on webservice
Bug fix