fix some validation bugs
fix validation bugs