Ajax loading working properly