modifed the codes
which looks fine