fix bug with file method