changes to support max width attribute