working and some bug fix