update render function, fix bug