fixing spatial reference errors