Removed logic to retry 5 time in case of failure.
Added catch block to catch generic exception.