Added domain middleware