Removed state variable and use x.value