Fixed 500 expection while creating collection  with the resource