made dostring crash-proof etc