Added render middleware