Caught exception caused by 409 error and simplified the code