added sign in check in base activity, refactored code