added if statement to check for a blank path