sanity checks

added some exceptions to check for sane input