check negative when allocate