On line 26 you define a new method-local variable with the same name as the class member. This hides the class member named scan, and inside the method you use the method-local variable only, so you never assign anything to the class member named scan.
You should remove the variable definition and simply assign to the class member: