implement rerender in a hacky way