Code amended to match client side call.