backwards compatible to rails 3