Added better native JS support to ui modal