Fix order in which frame scripts are invoked