fixed some bugs for w3 validation