added ab testing to middleware