Fix issue with DOMContentLoaded