moved list out of the public method so that it only get called once