added support for rails4