check for path validation
path validation and more rubustness