Render undefined bug fix