fixes double rendering bug (#748)