add in some error checking