add tap gesture for automatically restore state