fix index submit function