fix basename bug