fixing render bug