replaced old ajax method and extended new one