update code for dual rendering