Fix stack problem with transaction on DB.
Add settings