wrapped main calls into DOMContentLoaded event