bye bye global variable

use SharedPreferences instead