modified automated logout functionality