Fixed a bug in closing browser