modified if statement by adding regex for keys of params hash