Quick fix for avatar
Added common login and logout scripts.
Fixed some bugs