added delegate to handle response