add some input checks