Updating variable and alert