accounting for api level changes