fixing bug with path ending