Move ctrl.open check to top