fixed bug with lambda in has_many