A couple of changes

When I put this script live it gave me alot of errors that now should be
fixed