bug fix at fib function