Typecast resource id to integer