Fixed a bug for ransack