did some basic ass error checking