modified auto-logout