fixed return of renderRecord function so that it escaped to html properly