Made some corrections for ajax for loading instances