leaveProject refactored to properly work on views testing environment