Added support for dir attribute