Fix typerror on opening of new tab