Optimization of a NOx gas sensor based on single walled carbon nanotubes