timeout to check if we needto shutdown