Keep x variable in localStorage