added prepare functionality for worker context