added logic for cancel button in edit person