added new module for preserving last-dir