add pattern support