fixed the issue of checking if a vertex exsists or not