improve code for ffndb dialog.