Isn't there a need to handle the case where the siteAttribute isn't a String or a valid ID (logging/exceptions/display a message to the user)?