added pattern argument