added proper file operations