Fix API compatibility issue