starting cleanup function