[minor] Move default URL closer to the actual code.
[fix] Started work on double emit prevention.