Fixed ajax funcationality