[MAT-355] adding bad_alloc protection