FIX extend function