Helper throws an exception when trying to use empty dataset