correctly mask array.