added pattern guard