basic error checking