fixed some error upon revisit old practicing code