fixes compilation errors from priority build; add try catch for location