Fixed the issue where layers got added to a project multiple times if the device went to sleep while inserting the project.