Fixed double rendering bug