add shutdown function to allow bringing a replica down