bug #4630 AJAX request infinite loop

Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>