fixed initial rendering bug