fixes behaviour of select related popup