removed attach prior to saving project as it was returning NULL for project id in the pivot table