add gitignore
Added some error handling