added ref to generate button