added support for base dir