added checkLogin