added timeout to urlopen, removed if for type apps