add error checking for incorrect paths