fix clean_up implementation, prototype