do some validation