fixing Notice: Undefined index: isPublic