fix on code to check whether edge exists