Updated gitignore
Added beforeClose event