clean up shell function