make work correctly with rails