added global and middleware variables