added user validation and tests