fix bug with prev between directories