Fixing rendering bug