Fix bug about mocking submit function