fix bugs: allocate mem for filestr->filename, since it's a pointer. add add extr length to malloc when using strlen
fix bugs