Well it was doing nothing anyway because $res was never declared.

If you want compatibility with and without custom, you will need at least 2 lines…