Change commitTransaction() to use deleted flag