unclean flag implementation