Updated main js file with partially working edit button