render loop improved
fixed an offset bug