bug fix for creating and inserting new resources