Updated query 11 with error code