re-added open button, template version of function is updated before scope variable it uses...