Add timeout protection via a code injection technique