Fixed code as per ecto comments