Added in a safety lock

safety lock ensures that the objects dun have null variables. It should
solve some of the issues.