updated gitignore and fixed undefined variable bug