check string in a more secured way