Add auto submit functionality