fix OOIION-1099

fix https://jira.oceanobservatories.org/tasks/browse/OOIION-1099
In fact, with slightly simpler code.