submit function working