making sure scanners close to prevent resource leak warning