Added a bit of error checking