made snipits more robust