history functionality added