called functions in submit click instead of just invoking them