Fixed bug in nested ajax calls.