ordering fix in the lua script