get filetype once
fix s:close()