added replace_history_item and remove_history_item methods