Fixed a bug where public url could return before obtaining a token