Attribute fix

fixes https://gist.github.com/hh/5341841