Added delegate for state changes