created phone number validation function.