fix ff and add extract func