Changed method of getting local ip