add option to warn user on leaving page