prevent non-object access error