fixed NPE when creating a new version