Allocate memory in Reset