made pre and post collect functions asynchronous