initialized template and state button