z location bug fix in dipoleexample