take in a string safely