adjust scroll flags dyanmically