correct method to detect array, remove empty file