Got the flat model solving the problem, but I still need to add validation