Forgot to set global codeMode on choosing mode from dropdown.