change to directory before opening

qwandry#22