adds some basic error checking