cleaning and fixing rendering bug