Used more reliable mechanism DOMContentLoaded to trigger connect.