adding extended globbing and change consequently function that use grep