only scroll if necessary