Fixed js snippet