fix some error in sync and async js