connection to database finally works