Update to new API
Actually respect mode variable