Added empty list gaurd function expression to flatten