fix to finally established connection to database