When I tried to implement this stuff with scanner. why this is not working ?