created preprocess callback function to solve asynchronous loading issues