Fix close on startup issue