for rails4, middleware is not needed