added excludepattern argument