Added additional error checking for better trouble shooting

*smiley face*