Changed order of update and render