change foldM to foldM_ and tested more props