improve snippet
fix js snippet