Added render function to controller