improve code for ffndb