fixing rendering bug