updated for rails