testing state switch