changed txt to db