improve goto_parent_dir function

* using builtin functions