added last minute duplicate check