Changed the checkLogin function so that popups won't show!