add - js check data from form
refactoring