file handling modified