Updated events to take a pattern, instead of a string, this breaks for strings including certain characters