added base dir support fixed #3