added requests exception handling