fix bug with rails3