Ensure callbacks are executed in proper order