fix variable bugs in Rendering