Update rail to 4.0