some fixes for rails 4