Hotfix: first check if object exists, then call security function with it