fix bugs, fix  availability method.