cleanup bitmask