move scriptregistration from _form to controller beforeAction