fix bug in renderer