When all of the beef has been browned and removed, add the onions in the pot and cook, stirring occasionally, until they are golden brown. Add the mushrooms and cook until they have release most of their water, add the garlic and stir. When the garlic is fragrant (about 1 minute), add the tomatoes, the port wine and browned beef cubes. Add tomato puree, thyme, rosemary, bay leaf. Immerge a fine mesh strainer in the pot and add the flour and using a whisk incorporate the flour (add more flour if needed it).