Fixing bug when path is empty