fix filename_len, and save a few memory