added triggerError and connect to DB