minor bugfix in submit code