Fix bug in render