Added better handling for web services