Fix crash for api version < 11