some code cleaning
added a small code to prevent sending form twice