solved the problem iof the unclosed scanner