Quick fixing the quick fix of my embarrassing code