Agendas: bug fix - add coalesce so condition works for both sqlite and postgres + remove print