fixed rwmse memory allocation.