added validation to everything