fixing the delete function for bars