Added sharedpref global object and listener