user provided history cannot be more than maxHistory