fixed capacity bug