fixed bug in rendering