More lgic on edit