fix empty edges bug