             show_remaining = remaining + current - val
             show_remaining = Math.max(show_remaining, 0)
 
-            # compensate val by current set upgrade
-            if not @is_upgrade_input_valid(Math.max(val - current, 0), limit)
+            if not @is_upgrade_input_valid(Math.max(val, 0), limit)
                 label = <div style={UPGRADE_ERROR_STYLE}>Uncheck this: you do not have enough upgrades or exceed the limit</div>
             else
                 label = if val == 0 then 'Enable' else 'Enabled'

        # This function is quite confusing and tricky.
        # It combines the remaining upgrades of the user with the already applied ones by the same user.
        # Then it limits the applyable upgrades by what's still possible to apply until the maximum is reached.

        # NOTE : all units are ^ly 'internal' instead of display, e.g. seconds instead of hours
        quota_params = @props.quota_params
        # how much upgrade you have used between all projects
        used_upgrades = @props.upgrades_you_applied_to_all_projects
        # how much upgrade you currently use on this one project
        current = @props.upgrades_you_applied_to_this_project
        # how much unused upgrade you have remaining
        remaining = misc.map_diff(@props.upgrades_you_can_use, used_upgrades)
        # maximums you can use, including the upgrades already on this project
        limits = misc.map_sum(current, remaining)
        # additionally, the limits are capped by the maximum per project
        maximum = require('smc-util/schema').PROJECT_UPGRADES.max_per_project
        limits = misc.map_limit(limits, maximum)
        # all currently applied upgrades to this project
        project_upgrades = @props.total_project_quotas
        remainder_upgrades = misc.map_diff(maximum, project_upgrades)
        limits = misc.map_limit(limits, remainder_upgrades)
        # if there are already more upgrades than the limit, limits shouldn't be negative!
        limits = misc.map_max(limits, 0)
        return
            limits    : limits
            remaining : remaining
            current   : current
            totals    : project_upgrades

    clear_upgrades: ->
        @set_upgrades('min')


            val = @state["upgrade_#{name}"]
            if misc.parse_number_input(val)?
                if not @is_upgrade_input_valid(Math.max(val, 0), limit)
                    bs_style = 'error'
                    label = <div style={UPGRADE_ERROR_STYLE}>Value too high: not enough upgrades or exceeding limit</div>
                else
