check for dead end