Add grep checking
Update the shell script to include grep verfication