In the following discussion I have solved this issue by using another approach called async/await, here is the link: