Added code for asynchronous task