optimized errorhandling
fixed filepaths