cleanup path handling