change to_sym to to_s to avoid invalid sql in postgres