added some fixes on ajax