Fix bug with submit validity check logic