Fixed connection to the database