updated delete function for firebase