Add protective checks