Fix for state change not triggering calculation
formatting