notice function should be ok but not perfect