Fix bug

- in different situations API may return correct and incorrect path. We
fix it