fixing rendering bugs