corrected middlewareBrowsing, testMiddlewareCallback added