added error handlings
modified .gitignore