Renamed a variable and added final alert