properly change directory