fixed errors in rendering