fixed output removed broken code for flattening json