added delete function and popup