Did you mean to pass the mode variable here?