Moved submit post event listener into its own file and register it to the insertpost tempalte instad of home tempalte, this fixes double submit issue