Make script work with MutationObserver instead of setInterval