Added a errorHandler function to dbhelper.js