added code for request to run in separate thread.