replace entities to base dir