added rails 3 support