new version of check_mirror
added debug option in script