Code Fix and add function for Edit Button