added exception handling on urllib calls