fix rendering bugs