fixed deprecation error about addCollection