working loader in JS