added login status check