added null check for sharedFolder