fix viewport adjustment