added some more validation