fix little bugs on form
refactore template