Working with state variable