validate form for registration