fixed up order of execution