bug fix introduced with prerendering and refactor