fix some bug, add form validation (50%)