added apply in order to let angular know about login-logout