hook code for phone number validation