refactor check to form's save method