Apply deffense code on createSample button