some bug fixed and some changes