fixing size initialization problem for stack