may be it better to change it to try convert to integer and then to check that such a conversion succeed?