remove dirname function