validate and controller