fix bug in rendering