checkLogin ref error fixed