fixing the rendering timing issue once and for all