unique flag not working properly yet