make sure inputs are actually valid.

change from making sure input was not empty, to making sure input is
valid