Fix extension function