fixed an order of execution