added callback function to add more asynchronousity