fixed error on database connection