remove is_resource check, as it seems to always fail, even when valid