modified to work correctly with new web services