added delete function for an object from the db