a poor implementation of SafeArray