fixed enabled and variable scope