add method for alloc