use to_s instead of to_d for rails support