Bugfix subscription and transaction

Check if transaction and subscription become empty or null. If so, we
created it.