add google analytics
fix minor bug in app logic