remove some js calls, add sleep