Updated scanAllDirectory and work procedure.
Added checkIfNotEmpty and repeatPattern procedure.