use DOMContentLoaded the right way