Using support functions to make sure this works also in older APIs

Fixed this, otherwise we will have issues in older Android versions.