implement setting function