Added input verification