fixed bug with creating ajax methods