fixed logical error in render.py