Fixing render bug