fixed bug when using ~/ in the path args