Implemented submit functionality