Issue #2397459: make sure the space exists before creating token based on it