add the if statement to judge the submit and skip options

add the if statement to judge the submit & skip conditions