latest function not cleaning up: fixed