improved code sanitization when generating commands