a much simpler and cleaner fix