edited 'edit' in js