adding connections to DB with checking