check(PIEInstanceID != -1) assertion failed

I can follow your steps up until step 6. What type of variable is URL? Is Error a known variable or a variable for a custom error message? Can you provide the code for the class?