[fix] Proper file handling