improve validation, improve js