Yes, the code should check for duplicates. I think we should rather check the URL instead of the alias.