some validation code modified, and regex validation modified