Added parameters checking and retry on error