simplified the isCodecAvailable method