Fixing bug in external ip script