fix unused $res variable