fix bug in reserve loop