now should handle files corectly as well