changes to submit funtion