changed order of operations

This is a fix for issue 866 https://github.com/rcbops/chef-cookbooks/issues/866