Memory consumption fix