added facebook login with some global state keeping