fixed some rendering bugs