added if clause to Edit page