Fix ajax submits breaking throwing js error