problems with scanner and pattern storage