prevent memory errors