udpated for rails