Fixed crashing issues, implemented variables to turn off routing code