adds some validation stuff