some bug fixed and some function deprecated