Changed the editor check on edit click instead of on document load