Fix a bug that cause gen_fh to fail