bug fixed with testings