fixed render loop