fixed some validation bugs