fixed missing field after file, due to file not set to undefined after closing and state always reset to 1 after new chunk coming in