save current state (disable

warning about unsigned downcast