call update function for every frame