added logic for async calls