fixed scope and order problem