switch the definition order

so it follows the execution order