added some validation fun