added auto logout & login protection for all pages