slightly cleaner fix from matth