Fixed problem in submit script (had swapped 'then' and 'else' conditions)