fixed middleware

fixed middleware to not split the ENV['REGEX'] variable if it does not
exist (aka mistiq was not initialized)