String check method corrected