added some input checks