Telephone number check Function

tested and fixed undefined issue