 					if app.environment_variable?
 						_.extend(env, app.environment_variable)
 					remoteAppEnvs[app.id] = env
-					env = _.pick env, (val, key) ->
-						!_.includes(key, _.keys(specialActionEnvVars))
+					env = _.omit(env, _.keys(specialActionEnvVars))
 					return {
 						appId: '' + app.id
 						commit: app.commit

		err.message or err
	"#{failures.length} error#{s}: #{messages.join(' - ')}"

# Example callback function to enable/disable vpn
# enableVpn = (val) ->
# 	if val == '1' then console.log('Enabling VPN') else console.log('Disabling VPN')

specialActionEnvVars = {
	'RESIN_OVERRIDE_LOCK': null
	# @Praneeth: maybe add your vars here with a callback as value? e.g:
	# 'RESIN_ENABLE_VPN': enableVpn
}

UPDATE_IDLE = 0
UPDATE_UPDATING = 1

				remoteApps = _.indexBy(remoteApps, 'appId')
				remoteAppIds = _.keys(remoteApps)

				# Run special functions against variables if remoteAppEnvs has the corresponding variable function mapping.
				_.map specialActionEnvVars, (specialActionCallback, key) ->
					_.map remoteAppIds, (appId) ->
						if remoteAppEnvs[appId][key]? && specialActionCallback?
							# This makes the Special Action Envs only trigger their functions once.
							if executedSpecialActionEnvVars[key]?
								if executedSpecialActionEnvVars[key] != remoteAppEnvs[appId][key]
									specialActionCallback(remoteAppEnvs[appId][key])
							else
								specialActionCallback(remoteAppEnvs[appId][key])
						executedSpecialActionEnvVars[key] = remoteAppEnvs[appId][key]

				apps = _.indexBy(apps, 'appId')
				localApps = _.mapValues apps, (app) ->
