rectified error of undefined being accepted as an attribute value, added more test cases