fixed some render bugs