modifications for working edit mode