rails3 style, fix errors