fixed problem with saving data on ajax