ajax loader and bug fix