fixed bug in ff()