before contract ajax