BUGFIX: correct path to write parameters to

must preprend dir