bug fixex and corrections