Trying to fix the view centering logic