adjust code slightly to remove analyser warning