added module middleware