compltded existent check(with a few bugs)