Add .gitignore
Use conditional instead of try-catch