adding a render method so that the dom element can be passed