fixing bug with attribute locations in FF/chrome