added a bit of error checking, till need to fix URL issue