fix render and small bugs