edited goto_edit function