update allocate method