updated code snippets in readme

- fixed bug in code snippets