Change database to semantics3
Add extra checking