add median aggregate