connection to database in a function