state change function for Hat Items