fixed single attribute code so that it returns a list if it has a weight