Fixing problem of forEach