fixed Scanner loop
added some troubleshooting lines