fixed radio button / check box. converted template to function