bind function used for async calls.