Added filepath check for input.