Change directory before checking paths