path.resolve usage corrected to params instead of concatenation