Added in some safe guards

Apparently not enough