changed state variable to a boolean