fixed asynschronous problem when using restler