added error logging and .gitignore