improve input verification