write fb in function