better string and number check function