added delete function in class