Refactored getElementById not working on mainstrat