add validation to data base connection