More error checking, but no errors.

Not sure what's wrong