fixed execution order bug