Incorrect existence check, length could be zero and you would never be able to add aliases.