Fix bug in ajax request