Fix #2 not available in rails 4