base dir calculate