Adding detectPrefixEvent