add pattern match