Trying to fix horrifying bug