fixed transaction handling for isEmpty