added validation stuff