added some js helpers