added code to render fields