fixed crash with scanner