improved an ajax method.