moving render outside post request